home *** CD-ROM | disk | FTP | other *** search
- Path: taco.cc.ncsu.edu!news
- From: Alex David Groce <adgroce>
- Newsgroups: comp.lang.c
- Subject: I/O Question
- Date: 19 Jan 1996 21:16:38 GMT
- Organization: North Carolina State University
- Message-ID: <4dp1nm$mu6@taco.cc.ncsu.edu>
- NNTP-Posting-Host: c00993-224wi.eos.ncsu.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.12 (X11; I; SunOS 5.4 sun4m)
- X-URL: news:comp.lang.c/21953-22052
-
- I'm relatively inexperienced in C, was started with C++ here at NC State.
- Anyway, working on a project where speed really matters, I'm reading
- from a file containing 100001 integers in text format. I was originally
- using C++'s iostreams, but discovered the using stdio.h speeded things up
- by an incredible factor. I guess the C++ routines are so general that
- they're slllooooooooww as molasses. Anyway, I'm using scanf now, as in
-
- while (scanf("%i", &list[count++]) != EOF); // Read elements.
- count--; // Avoid good old OBOB, the Off-By-One-Bug.
-
- Would it be worth my time to learn buffered I/O techniques, read or
- getchar or such, to input this data? Every little bit of time
- counts... Or is there a good example somewhere of a fast way to do
- this?
-
- --
- "And ye shall know the truth, and the truth shall set you free." - John 8:32
- --
- Alex David Groce (adgroce@eos.ncsu.edu)
- Sophomore (Computer Science/Multi-Disciplinary Studies/Applied Mathematics)
- 1995-96 DPMA Secretary
- 1005B Sullivan Hall (512-5172)
- http://www4.ncsu.edu/eos/users/a/adgroce/WWW/index.html
-
-